package com.house.entity;

import com.house.utils.Constant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLInsert;
import org.hibernate.annotations.Where;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author: GGP
 * @description: 提取公共属性
 * @time: 2023-03-01 11:19
 **/

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@ToString
@ApiModel
public class CommonProperties{
	/**
	 * id
	 */
	@ApiModelProperty(value = "id",name = "id",example = "1",required = true)
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Integer id;
	/**
	 * 创建者
	 */
	@CreatedBy
	@Column(name = "create_by")
	@ApiModelProperty(value = "创建者",name = "createBy",required = true)
	public String createBy;

	/**
	 * 创建日期
	 */
	@CreatedDate
	@Column(name = "create_date")
	@ApiModelProperty(value = "创建日期",name = "createDate",required = true)
	public Date createDate;

	/**
	 * 更新者
	 */
	@LastModifiedBy
	@Column(name = "update_by")
	@ApiModelProperty(value = "更新者",name = "updateBy",required = true)
	public String updateBy;

	/**
	 * 更新日期
	 */
	@LastModifiedDate
	@Column(name = "update_date")
	@ApiModelProperty(value = "更新日期",name = "updateDate",required = true)
	public Date updateDate;

	/**
	 * 删除标志
 	 */
	@Column(name = "del_flag")
	@ApiModelProperty(value = "删除标识",name = "delFlag",required = true)
	public Integer delFlag = Constant.DEL_FLAG;

}


